#include "realization.h"

double* Sum (double** vecArr, int count, int dim)
{
	double* solution = new double [dim];

	for(int i = 0; i < dim; i++)
		solution[i] = 1;

	for(int i = 0; i < dim; i++)
	{
		for(int j = 0; j < count; j++)
			solution[i] = exp( sin(solution[i]) * cos(vecArr[j][i]));
			
	}

	return solution;
}

double* parallelSum (double** vecArr, int count, int dim)
{
	double* solution = new double [dim];

	
	#pragma omp parallel for
	for(int i = 0; i < dim; i++)
		solution[i] = 1;

	#pragma omp parallel for
	for(int i = 0; i < dim; i++)
	{
		for(int j = 0; j < count; j++)
		{
			solution[i] = exp( sin(solution[i]) * cos(vecArr[j][i]));
		}

	}
	return solution;
}